package com.vancouver.knows.business.tracker;

import com.pangu.task.IResultReceiver;
import com.pangu.task.OperateResult;
import com.pangu.util.StringUtil;
import com.vancouver.knows.business.BSharedPrefManager;
import com.vancouver.knows.business.BusinessModule;

/**
 * 保存userIdHash key
 * @author LLF
 * 
 */
public class UserHashTracker extends ABInvokeTracker {

	public UserHashTracker(BusinessModule module, IResultReceiver resultReceiver) {
		super(module, resultReceiver);
	}

	@Override
	public String TAG() {
		return UserHashTracker.class.getSimpleName();
	}

	@Override
	public void handleResult(OperateResult result) {
		String userIdHash = (String) result.getResultData();
		if(!StringUtil.isEmptyString(userIdHash)){
			BSharedPrefManager sharedPrefManager = new BSharedPrefManager(imContext);
			sharedPrefManager.saveUserIdHash(userIdHash);
		}
	}
}
